package com.ytjj.qmyx.admin.service.impl;

import com.ytjj.qmyx.admin.constants.SysConfigConstants;
import com.ytjj.qmyx.admin.mapper.CategoryNowMapper;
import com.ytjj.qmyx.admin.model.CategoryNow;
import com.ytjj.qmyx.admin.model.CategoryNowExample;
import com.ytjj.qmyx.admin.service.CategoryNowService;
import com.ytjj.qmyx.mall.model.ProductCategory;
import com.ytjj.qmyx.mall.model.ProductCategoryExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 *
 * 
 * @description:
 */
@Service
public class CategoryNowServiceImpl implements CategoryNowService {

    @Resource
    private CategoryNowMapper categoryNowMapper;

    @Override
    public List<CategoryNow> getFirstList() {
        CategoryNowExample categoryNowExample = new CategoryNowExample();
        categoryNowExample.createCriteria().andPidEqualTo(0).andStatusEqualTo(SysConfigConstants.STATUS_1);
        return categoryNowMapper.selectByExample(categoryNowExample);
    }

    @Override
    public List<CategoryNow> getSecondList(Integer id) {
        CategoryNowExample categoryNowExample = new CategoryNowExample();
        categoryNowExample.createCriteria().andPidEqualTo(id).andStatusEqualTo(SysConfigConstants.STATUS_1);
        return categoryNowMapper.selectByExample(categoryNowExample);
    }
}
